#!/bin/sh

usage="usage: lecture room\n room: [ informatikhörsaal | hlawka ]"

[ $# -lt 1 ] && echo ${usage} && exit 1

player=mpv
link=

for arg in "$@"; do
    case ${arg} in
        informatikhörsaal)
            link=https://live.video.tuwien.ac.at/lt-live/deu116-informatikhoersaal/playlist.m3u8
            ;;
        hlawka)
            link=https://live.video.tuwien.ac.at/lt-live/caeg17-ei-9-hlawka-hs/playlist.m3u8
            ;;
        paschke)
            link=https://live.video.tuwien.ac.at/lt-live/caeg31-ei-10-fritz-paschke-hs/playlist.m3u8
    esac
done

$player $link
